# +----------------------------------------------------------------------
# | ChatWork智能聊天办公系统
# +----------------------------------------------------------------------
# | 软件声明: 本系统并非自由软件,未经授权任何形式的商业使用均属非法。
# | 版权保护: 任何企业和个人不允许对程序代码以任何形式任何目的复制/分发。
# | 授权要求: 如有商业使用需求,请务必先与版权所有者取得联系并获得正式授权。
# +----------------------------------------------------------------------
# | Author: ChatWork Team <2474369941@qq.com>
# +----------------------------------------------------------------------
from pydantic import BaseModel, Field


class MjModelParams(BaseModel):
    """ 模式参数 """
    status: bool = Field(default=False, description="状态")
    points: int = Field(default=0, ge=0, description="积分")


class MjModeOptions(BaseModel):
    """ 模式选项 """
    fast: MjModelParams = Field(..., description="快速模式")
    relax: MjModelParams = Field(..., description="慢速模式")
    turbo: MjModelParams = Field(..., description="极速模式")


class MjSetting(BaseModel):
    """ Mj绘画配置参数 """
    name: str = Field(default="", max_length=100, description="应用名称")
    status: int = Field(..., ge=0, le=1, description="功能开关: [0=关, 1=开]")
    channel: str = Field(..., description="接口渠道: [mj_zsy, mj_goapi]")
    mode: MjModeOptions = Field(..., description="生成模式: [fast, relax, turbo]")

    class Config:
        json_schema_extra = {
            "example": {
                "name": "MJ绘画",
                "status": 1,
                "channel": "zsy",
                "mode": {
                    "fast": {
                        "status": True,
                        "points": 10
                    },
                    "relax": {
                        "status": True,
                        "points": 5
                    },
                    "turbo": {
                        "status": True,
                        "points": 20
                    }
                }
            }
        }


"""--------------- Separator ---------------"""


class SdSetting(BaseModel):
    """ SD绘画配置参数 """
    name: str = Field(default="", max_length=100, description="应用名称")
    status: int = Field(..., ge=0, le=1, description="功能开关: [0=关, 1=开]")
    points: int = Field(default=0, ge=0, description="积分收费")
    agency_api: str = Field(..., max_length=900, description="代理地址")

    class Config:
        json_schema_extra = {
            "example": {
                "name": "SD绘画",
                "status": 1,
                "points": 10,
                "agency_api": "https://xx.cn/v1"
            }
        }


"""--------------- Separator ---------------"""


class DalleSetting(BaseModel):
    """ DALLE绘画配置参数 """
    name: str = Field(default="", max_length=100, description="应用名称")
    status: int = Field(..., ge=0, le=1, description="功能开关: [0=关, 1=开]")
    points: int = Field(default=0, ge=0, description="积分收费")
    agency_api: str = Field(default="", max_length=800, description="代理地址")

    class Config:
        json_schema_extra = {
            "example": {
                "name": "DALLE绘画",
                "status": 1,
                "points": 10,
                "agency_api": "https://xx.com/v1"
            }
        }


"""--------------- Separator ---------------"""


class DoubaoSetting(BaseModel):
    """ 豆包绘画配置参数 """
    name: str = Field(default="", max_length=100, description="应用名称")
    status: int = Field(..., ge=0, le=1, description="功能开关: [0=关, 1=开]")
    points: int = Field(default=0, ge=0, description="积分收费")

    class Config:
        json_schema_extra = {
            "example": {
                "name": "豆包绘画",
                "status": 1,
                "points": 10
            }
        }
